namespace Shell32
{
    using System;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;

    [ComImport, Guid("D8F015C0-C278-11CE-A49E-444553540000"), TypeLibType((short)0x1050)]
    public interface IShellDispatch
    {
        [DispId(0x60020000)]
        object Application { [return: MarshalAs(UnmanagedType.IDispatch)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60020000)] get; }

        [DispId(0x60020001)]
        object Parent { [return: MarshalAs(UnmanagedType.IDispatch)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60020001)] get; }

        [return: MarshalAs(UnmanagedType.Interface)]
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60020002)]
        Folder NameSpace([In, MarshalAs(UnmanagedType.Struct)] object vDir);

        [return: MarshalAs(UnmanagedType.Interface)]
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60020003)]
        Folder BrowseForFolder([In] int Hwnd, [In, MarshalAs(UnmanagedType.BStr)] string Title, [In] int Options, [In, Optional, MarshalAs(UnmanagedType.Struct)] object RootFolder);

        [return: MarshalAs(UnmanagedType.IDispatch)]
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60020004)]
        object Windows();

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60020005)]
        void Open([In, MarshalAs(UnmanagedType.Struct)] object vDir);

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60020006)]
        void Explore([In, MarshalAs(UnmanagedType.Struct)] object vDir);

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60020007)]
        void MinimizeAll();

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60020008)]
        void UndoMinimizeALL();

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60020009)]
        void FileRun();

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x6002000a)]
        void CascadeWindows();

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x6002000b)]
        void TileVertically();

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x6002000c)]
        void TileHorizontally();

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x6002000d)]
        void ShutdownWindows();

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x6002000e)]
        void Suspend();

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x6002000f)]
        void EjectPC();

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60020010)]
        void SetTime();

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60020011)]
        void TrayProperties();

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60020012)]
        void Help();

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60020013)]
        void FindFiles();

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60020014)]
        void FindComputer();

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60020015)]
        void RefreshMenu();

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60020016)]
        void ControlPanelItem([In, MarshalAs(UnmanagedType.BStr)] string bstrDir);
    }

    [ComImport, Guid("A4C6892C-3BA9-11D2-9DEA-00C04FB16162"), TypeLibType((short)0x1050)]
    public interface IShellDispatch2 : IShellDispatch
    {
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60030000)]
        int IsRestricted([In, MarshalAs(UnmanagedType.BStr)] string Group, [In, MarshalAs(UnmanagedType.BStr)] string Restriction);

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60030001)]
        void ShellExecute([In, MarshalAs(UnmanagedType.BStr)] string File, [In, Optional, MarshalAs(UnmanagedType.Struct)] object vArgs, [In, Optional, MarshalAs(UnmanagedType.Struct)] object vDir, [In, Optional, MarshalAs(UnmanagedType.Struct)] object vOperation, [In, Optional, MarshalAs(UnmanagedType.Struct)] object vShow);

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60030002)]
        void FindPrinter([In, Optional, MarshalAs(UnmanagedType.BStr)] string Name, [In, Optional, MarshalAs(UnmanagedType.BStr)] string location, [In, Optional, MarshalAs(UnmanagedType.BStr)] string model);

        [return: MarshalAs(UnmanagedType.Struct)]
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60030003)]
        object GetSystemInformation([In, MarshalAs(UnmanagedType.BStr)] string Name);

        [return: MarshalAs(UnmanagedType.Struct)]
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60030004)]
        object ServiceStart([In, MarshalAs(UnmanagedType.BStr)] string ServiceName, [In, MarshalAs(UnmanagedType.Struct)] object Persistent);

        [return: MarshalAs(UnmanagedType.Struct)]
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60030005)]
        object ServiceStop([In, MarshalAs(UnmanagedType.BStr)] string ServiceName, [In, MarshalAs(UnmanagedType.Struct)] object Persistent);

        [return: MarshalAs(UnmanagedType.Struct)]
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60030006)]
        object IsServiceRunning([In, MarshalAs(UnmanagedType.BStr)] string ServiceName);

        [return: MarshalAs(UnmanagedType.Struct)]
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60030007)]
        object CanStartStopService([In, MarshalAs(UnmanagedType.BStr)] string ServiceName);

        [return: MarshalAs(UnmanagedType.Struct)]
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60030008)]
        object ShowBrowserBar([In, MarshalAs(UnmanagedType.BStr)] string bstrClsid, [In, MarshalAs(UnmanagedType.Struct)] object bShow);
    }

    [ComImport, Guid("177160CA-BB5A-411C-841D-BD38FACDEAA0"), TypeLibType((short)0x1050)]
    public interface IShellDispatch3 : IShellDispatch2
    {
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60040000)]
        void AddToRecent([In, MarshalAs(UnmanagedType.Struct)] object varFile, [In, Optional, MarshalAs(UnmanagedType.BStr)] string bstrCategory);
    }

    [ComImport, Guid("EFD84B2D-4BCF-4298-BE25-EB542A59FBDA"), TypeLibType((short)0x1050)]
    public interface IShellDispatch4 : IShellDispatch3
    {
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60050000)]
        void WindowsSecurity();

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60050001)]
        void ToggleDesktop();

        [return: MarshalAs(UnmanagedType.Struct)]
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60050002)]
        object ExplorerPolicy([In, MarshalAs(UnmanagedType.BStr)] string bstrPolicyName);

        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60050003)]
        bool GetSetting([In] int lSetting);
    }

    [ComImport, TypeLibType((short)0x1050), Guid("866738B9-6CF2-4DE8-8767-F794EBE74F4E")]
    public interface IShellDispatch5 : IShellDispatch4
    {
        [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime), DispId(0x60060000)]
        void WindowSwitcher();
    }
}

